﻿@model KPIS.GERP.Models.HRM.PsAbsence
@{
    ViewBag.Title = "ข้อมูลใบลา [AB]";
    if (CompareUtility.IsObjectToStringEqual(Request["emptylayout"], "true") || CompareUtility.IsObjectToStringEqual(Request["nolayout"], "true"))
    {
        Layout = "~/Views/Shared/_EmptyLayout.cshtml";
    }
    if(Model != null)
    {
        string recordStatusName = "";
        switch (Model.RecordStatus)
                                {
                                            case "W": recordStatusName= "ยังไม่ส่งขออนุมัติ";break;
                                            case "J": recordStatusName= "ไม่ผ่านการอนุมัติ";break;
                                            case "U": recordStatusName= "ใช้งานอยู่";break;
                                            case "A": recordStatusName= "อนุมัติแล้ว";break;
                                            case "R": recordStatusName= "ถูกส่งกลับให้แก้ไข";break; 
                                            case "P": recordStatusName= "รออนุมัติ";break; 
                                            case "C": recordStatusName= "ยกเลิก";break; 
                                            case "D": recordStatusName= "ลบ";break; 
                                } 
        string desc = "ของ " + Model.Employee.FullName + " วันที่ " +
                      Model.StartDate.Value.ToString("dd/MM/yyyy") + " " +
                      (Model.StartTime == "M" ? "ตั้งแต่ช่วงเช้า" : "ตั้งแต่ช่วงบ่าย") + " - " +
                      Model.EndDate.Value.ToString("dd/MM/yyyy") + " " +
                      (Model.EndTime == "M" ? "ถึงช่วงเช้า" : "ถึงช่วงบ่าย") + " [" + recordStatusName + "]";
        ViewBag.Descr = desc;
    }
}
@Html.Partial("_DetailsForm", Model)